3.59 \(\int \cos (c+d x) (A+B \sec (c+d x)+C \sec ^2(c+d x)) \, dx\)

Optimal. Leaf size=27 \[ \frac{A \sin (c+d x)}{d}+B x+\frac{C \tanh ^{-1}(\sin (c+d x))}{d} \]

[Out]

B*x + (C*ArcTanh[Sin[c + d*x]])/d + (A*Sin[c + d*x])/d

________________________________________________________________________________________

Rubi [A]  time = 0.049924, antiderivative size = 27, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.148, Rules used = {4047, 8, 4045, 3770} \[ \frac{A \sin (c+d x)}{d}+B x+\frac{C \tanh ^{-1}(\sin (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]*(A + B*Sec[c + d*x] + C*Sec[c + d*x]^2),x]

[Out]

B*x + (C*ArcTanh[Sin[c + d*x]])/d + (A*Sin[c + d*x])/d

Rule 4047

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(
C_.)), x_Symbol] :> Dist[B/b, Int[(b*Csc[e + f*x])^(m + 1), x], x] + Int[(b*Csc[e + f*x])^m*(A + C*Csc[e + f*x
]^2), x] /; FreeQ[{b, e, f, A, B, C, m}, x]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 4045

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*(csc[(e_.) + (f_.)*(x_)]^2*(C_.) + (A_)), x_Symbol] :> Simp[(A*Cot[e
 + f*x]*(b*Csc[e + f*x])^m)/(f*m), x] + Dist[(C*m + A*(m + 1))/(b^2*m), Int[(b*Csc[e + f*x])^(m + 2), x], x] /
; FreeQ[{b, e, f, A, C}, x] && NeQ[C*m + A*(m + 1), 0] && LeQ[m, -1]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \cos (c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=B \int 1 \, dx+\int \cos (c+d x) \left (A+C \sec ^2(c+d x)\right ) \, dx\\ &=B x+\frac{A \sin (c+d x)}{d}+C \int \sec (c+d x) \, dx\\ &=B x+\frac{C \tanh ^{-1}(\sin (c+d x))}{d}+\frac{A \sin (c+d x)}{d}\\ \end{align*}

Mathematica [A]  time = 0.0172103, size = 38, normalized size = 1.41 \[ \frac{A \sin (c) \cos (d x)}{d}+\frac{A \cos (c) \sin (d x)}{d}+B x+\frac{C \tanh ^{-1}(\sin (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]*(A + B*Sec[c + d*x] + C*Sec[c + d*x]^2),x]

[Out]

B*x + (C*ArcTanh[Sin[c + d*x]])/d + (A*Cos[d*x]*Sin[c])/d + (A*Cos[c]*Sin[d*x])/d

________________________________________________________________________________________

Maple [A]  time = 0.044, size = 41, normalized size = 1.5 \begin{align*} Bx+{\frac{A\sin \left ( dx+c \right ) }{d}}+{\frac{Bc}{d}}+{\frac{C\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)*(A+B*sec(d*x+c)+C*sec(d*x+c)^2),x)

[Out]

B*x+A*sin(d*x+c)/d+1/d*B*c+1/d*C*ln(sec(d*x+c)+tan(d*x+c))

________________________________________________________________________________________

Maxima [A]  time = 0.934211, size = 62, normalized size = 2.3 \begin{align*} \frac{2 \,{\left (d x + c\right )} B + C{\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 2 \, A \sin \left (d x + c\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(A+B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="maxima")

[Out]

1/2*(2*(d*x + c)*B + C*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + 2*A*sin(d*x + c))/d

________________________________________________________________________________________

Fricas [A]  time = 0.507179, size = 120, normalized size = 4.44 \begin{align*} \frac{2 \, B d x + C \log \left (\sin \left (d x + c\right ) + 1\right ) - C \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, A \sin \left (d x + c\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(A+B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="fricas")

[Out]

1/2*(2*B*d*x + C*log(sin(d*x + c) + 1) - C*log(-sin(d*x + c) + 1) + 2*A*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (A + B \sec{\left (c + d x \right )} + C \sec ^{2}{\left (c + d x \right )}\right ) \cos{\left (c + d x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(A+B*sec(d*x+c)+C*sec(d*x+c)**2),x)

[Out]

Integral((A + B*sec(c + d*x) + C*sec(c + d*x)**2)*cos(c + d*x), x)

________________________________________________________________________________________

Giac [B]  time = 1.16414, size = 95, normalized size = 3.52 \begin{align*} \frac{{\left (d x + c\right )} B + C \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 1 \right |}\right ) - C \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1 \right |}\right ) + \frac{2 \, A \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 1}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(A+B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="giac")

[Out]

((d*x + c)*B + C*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - C*log(abs(tan(1/2*d*x + 1/2*c) - 1)) + 2*A*tan(1/2*d*x +
 1/2*c)/(tan(1/2*d*x + 1/2*c)^2 + 1))/d